package com.xiegang.serviceMap.controller;

import com.xiegang.internalcommon.dto.ForecastPriceDto;
import com.xiegang.internalcommon.dto.ResponseResult;
import com.xiegang.serviceMap.service.DriectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xieGang
 * @description
 * @date 2023/3/12 16:03
 **/

@RestController
public class DriectionController {

    @Autowired
    private DriectionService driectionService;

    @PostMapping("/driving")
    public ResponseResult driving(@RequestBody ForecastPriceDto forecastPriceDto){

        String depLongitude = forecastPriceDto.getDepLongitude();
        String deplatitude = forecastPriceDto.getDeplatitude();
        String destLongitude = forecastPriceDto.getDestLongitude();
        String destLatiude = forecastPriceDto.getDestLatiude();

        return driectionService.driving(depLongitude,deplatitude,destLongitude,destLatiude);
    }
}
